
.panel.panel-default
  .panel-heading
    =link_to"车型", {:action => 'car_mo_check', :controller=>'car_brands', :remote=>true}, {class: 'btn btn-primary btn-xs glyphicon glyphicon-search'} 
  .panel-body

     = simple_form_for(@customer, html: {class: 'form-vertical', novalidate: true}, wrapper: :vertical_form) do |o|
        .row
          .col-md-3
            - if params[:car_mo_check]
              = o.input :car_mo, label: '车型', input_html: {value: "#{@car_brand.name}/#{@car_model.name}"}
                 
            - else
              = o.input :car_mo, label: '车型'

            = o.input :car_num, label: '车牌号', input_html: {value: "粤S"}
              
          .col-md-3
            = o.association :customer_level, label: '级别', collection: CustomerLevel.all, include_blank: false
            = o.input :name, label: '姓名'
          .col-md-3
            = o.input :car_colour, label: '颜色', collection: ["红色", "绿色", "蓝色","粉色", "银色", "黑色","白色", "黄色", "灰色","珍珠白", "香槟金"]
            = o.input :phone, label: '电话'
          .col-md-3
            = o.input :car_fnum, label: '车架号'
            = o.input :car_enum, label: '发动机号'
        .row
          button type="button" class="btn btn-primary btn-xs glyphicon glyphicon-plus-sign" data-toggle="collapse" data-target="#demo1" style="margin-left:15px;"
          |*客户详细信息
          
          .collapse id="demo1" 
            .col-md-3
              = o.input :telephone, label: '固定电话'
              = o.input :age, label: '年龄'
              = o.input :id_num, label: '证件号码'
              = o.input :customer_source, label: '客户来源', collection: ["整车销售", "互联网", "主动上门","客户介绍", "内部客户", "单位客户","朋友介绍"]
            .col-md-3
              = o.input :qq, label: 'QQ'
              = o.input :birthday, label: '生日', as: :date, html5: true
              = o.input :addr, label: '联系地址'
              = o.input :customer_type, label: '客户类型', collection: ["单位客户", "个人客户", "内部客户","零售客户", "渠道客户", "关系客户"]
            .col-md-3
              = o.input :email, label: '邮箱'
              = o.input :occupation, label: '职业', collection: ["企业主管", "政府公务员", "技术工程师","市场销售人员", "行政人员", "会计财务", "设计师"]
              = o.input :zip_code, label: '邮编'
            .col-md-3
              = o.input :sex, label: '性别', collection: ["男", "女"]
              = o.input :driving_expire, label: '驾驶证到期日', as: :date, html5: true
              = o.input :fax, label: '传真'
        .row
          button type="button" class="btn btn-primary btn-xs glyphicon glyphicon-plus-sign" data-toggle="collapse" data-target="#demo2" style="margin-left:15px;"
          |*车辆详细信息
          
          .collapse id="demo2" 
            .col-md-3
              = o.input :of_date, label: '出厂日期', as: :date, html5: true
              = o.input :buy_date, label: '购买日期', as: :date, html5: true
              = o.input :force_expire, label: '交强险到期日', as: :date, html5: true
              = o.input :commercial_expire, label: '商业险到期日', as: :date, html5: true
            .col-md-3
              = o.input :last_cf_date, label: '最近来厂日期', as: :date, html5: true
              = o.input :last_cf_mileage, label: '最近来厂里程'
              = o.input :last_care_date, label: '最近保养日期', as: :date, html5: true
              = o.input :last_care_mileage, label: '最近保养里程'
            .col-md-3
              = o.input :fix_care_mileage, label: '定保里程'
              = o.input :fix_care_cycle, label: '定保周期'
              = o.input :next_care_date, label: '下次保养日期', as: :date, html5: true
              = o.input :next_care_mileage, label: '下次保养里程' 
            .col-md-3
              = o.association :insurer, label: '交强险保险公司', collection: Insurer.all
            
              = o.input :year_inspect_date, label: '年检日期', as: :date, html5: true
              = o.input :active_status, label: '活跃状态', collection: ["活跃", "休眠", "流失","问题", "危机"]
              = o.input :oil_meter, label: '油表数', collection: ["1/2", "1/3", "1/4","1/5", "2/3", "2/5", "3/4", "3/5", "4/5", "满油", "缺油"]
        br    
        .row
            = o.button :submit, "保存", :class => 'btn-success btn-xs', :style =>'margin-left:15px'